package Thread;

/*
 * 线程优先级、
 * 在java中线程的默认优先级为5 优先级最高为10最低为1
 * */
public class PriorityDemo {
    public static void main(String[] args) {
        Thread t1 = new Thread() {
            @Override
            public void run() {
                for (int i = 0; i < 10000; i++) {
                    System.out.println("max");
                }
            }
        };

        Thread t2 = new Thread() {
            @Override
            public void run() {
                for (int i = 0; i < 10000; i++) {
                    System.out.println("min");
                }
            }
        };

        Thread t3 = new Thread() {
            @Override
            public void run() {
                for (int i = 0; i < 10000; i++) {
                    System.out.println("nor");
                }
            }
        };

        t1.setPriority(10);
        t2.setPriority(1);

        t1.start();
        t2.start();
        t3.start();
    }
}
